package com.huawei.hwid.core.d.a;

import android.content.Context;
import android.text.TextUtils;
import com.huawei.hwid.core.d.b.e;
import com.huawei.hwid.core.d.g;
import java.util.ArrayList;
import java.util.List;

public class c {
    private static List<a> a = new ArrayList();

    static {
        a.add(new d());
        a.add(new b());
    }

    public static synchronized void a(Context context) {
        synchronized (c.class) {
            int parseInt;
            Object b = g.b(context, "encryptversion");
            int i = -1;
            if (!TextUtils.isEmpty(b)) {
                try {
                    parseInt = Integer.parseInt(b);
                } catch (Exception e) {
                    e.d("VersionUpdateHelper", "parse encryptversion error:", true);
                }
                if (parseInt < 3) {
                    for (a a : a) {
                        a.a(context, parseInt, 3);
                    }
                }
                g.a(context, "encryptversion", String.valueOf(3));
            }
            parseInt = i;
            if (parseInt < 3) {
                while (r3.hasNext()) {
                    a.a(context, parseInt, 3);
                }
            }
            g.a(context, "encryptversion", String.valueOf(3));
        }
    }
}
